<template>
<div style="width : 50%;margin : 60px auto auto">
  <el-form ref="form" :model="form" label-width="80px" style="width: 50%;display: flex;flex-direction: column;align-items: center;">
  <el-form-item label="客户姓名" style="min-width: 400px;">
    <el-input v-model="form.consumerName" style="width:90%"></el-input>
  </el-form-item>
  <el-form-item label="证件类型" style="min-width: 400px;">
    <el-select v-model="form.credentialType" placeholder="请选择证件类型" style="width:90%">
      <el-option label="身份证" value="IDENTITY_CARD"></el-option>
      <el-option label="台胞证" value="null"></el-option>
    </el-select>
  </el-form-item>
    <el-form-item label="证件号码" style="min-width: 400px;">
    <el-input v-model="form.credentialNumber" style="width:90%"></el-input>
  </el-form-item>
      <el-form-item label="银行卡号" style="min-width: 400px;">
    <el-input v-model="form.cardId" style="width:90%"></el-input>
  </el-form-item>
    <el-form-item label="联系方式" style="min-width: 400px;">
    <el-input v-model="form.phone" style="width:90%"></el-input>
  </el-form-item>

  <el-form-item label="风险等级" style="min-width: 400px;">
    <el-select v-model="form.riskLevel" placeholder="请选择风险等级" style="width:90%">
      <el-option label="高" value="HIGH"></el-option>
      <el-option label="中" value="MEDIUM"></el-option>
      <el-option label="低" value="LOW"></el-option>
      
    </el-select>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>
</div>
</template>


<script>
  export default {
    data() {
      return {
        form: {
          consumerName: '',
          credentialNumber:'',
          credentialType:"IDENTITY_CARD",
          phone:'',
          riskLevel:'LOW',
          cardId: '',
        }
      }
    },
    methods: {
      onSubmit() {
        console.log(this.form.credentialNumber);
        if(this.form.credentialNumber!=''){
          this.$message({
          message: '成功开户',
          type: 'success'
        });
        }else{
          this.$message('开户失败，请检查表单填写');
        }
        
      }
    }
  }
</script>